package org.liveboardgames.agricola.control.delegates
{
    import flash.utils.setTimeout;
    
    import org.liveboardgames.agricola.vo.card.Card;
    import org.liveboardgames.agricola.vo.player.Player;
    
    import mx.rpc.IResponder;
    
    public class PlayMultipleCardDelegate
    {
        private var _responder:IResponder;
        
        private var _service:Object;
        
        public function PlayMultipleCardDelegate(responder:IResponder)
        {
            // this.service = ServiceLocator.getInstance().getRemoteObject( "helloWorldService" );
            this._responder = responder;
        }
        
        public function playCard(player:Player, card:Card, quantity:int):void
        {
            setTimeout(playCardService, 0, player, card, quantity);
        }
        
        private function playCardService(player:Player, card:Card, quantity:int):void
        {
            for (var i:int = 0; i < quantity; i++)
            {
                player.farm.addPlayedCard(card);
            }
        }
    }
}